/**
 * 注册DTO
 * 作者：GodMainCode
 * 创建时间：2024-01-17
 * 修改时间：2024-01-17
 * 修改人：GodMainCode
 */

import { IsString, IsEmail, MinLength, IsOptional } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class RegisterDto {
  @ApiProperty({ 
    description: '用户名', 
    example: 'john_doe',
    minLength: 3 
  })
  @IsString()
  @MinLength(3)
  username: string;

  @ApiProperty({ 
    description: '密码', 
    example: '********',
    minLength: 6 
  })
  @IsString()
  @MinLength(6)
  password: string;

  @ApiProperty({ 
    description: '邮箱', 
    example: 'john@example.com',
    required: false 
  })
  @IsEmail()
  @IsOptional()
  email?: string;
} 